package com.zzty.train.serviceImpl;


import com.zzty.train.dao.QuestionDao;
import com.zzty.train.entity.Question;
import com.zzty.train.service.QuestionService;
import com.zzty.train.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionServiceImpl implements QuestionService {
    @Autowired
    QuestionDao questionDao;
    @Autowired
    QuestionDao questionMapper;
    @Override
    public List<Question>getQuestion(){
        List<Question>questions=questionDao.getQuestion();
        return questions;
    }
    @Override
    public Integer getQuestionCount(){
        Integer count = questionDao.getQuestionCount();
        return count;
    }
    @Override
    public List<Question>getPageQuestion(PageUtils pageUtils){
        List<Question>getPageQuestion=questionDao.getPageQuestion(pageUtils);
        return getPageQuestion;
    }

    @Override
    public Integer addQuestion(Question question){
        Integer count=questionDao.addQuestion(question);
        return count;
    }

    @Override
    public Question addContent(Question question) {
        Question question1=question;
        questionMapper.addContent(question1);
        return question1;
    }

    @Override
    public List getAllQuestion() {
        List<Question> questions=questionMapper.getAllQuestion();
        return questions;
    }

}
